﻿<phone:PhoneApplicationPage 
    x:Class="SignalLab.RecordDetails"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot">
    <Grid.Resources>

    </Grid.Resources>
    <Grid.Background>
      <ImageBrush ImageSource="/SignalLab;component/background_record.jpg" Stretch="UniformToFill" />
    </Grid.Background>

    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
      <TextBlock x:Name="ApplicationTitle" Text="{Binding ApplicationName}" Style="{StaticResource PhoneTextNormalStyle}"/>
      <TextBlock x:Name="PageTitle" Text="{Binding RecordName}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
      <StackPanel>
        <Button Name="btnUpload" Content="Upload" VerticalAlignment="Top" Click="btnUpload_Click" />
        <Button Name="btnDelete" Content="Delete" VerticalAlignment="Top" Click="btnDelete_Click" />

        <Border HorizontalAlignment="Stretch" Height="150" MinWidth="400" Background="#9009" BorderBrush="Blue" BorderThickness="1" >
          <Image Name="imgVisualiser" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
        </Border>

      </StackPanel>


      <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
                 Visibility="{Binding IsUploading, Converter={StaticResource VisibilityConverter}}"
                 RenderTransformOrigin="0.5,0.5">
        <TextBlock.Triggers>
          <EventTrigger RoutedEvent="TextBlock.Loaded">
            <BeginStoryboard>
              <BeginStoryboard.Storyboard>
                <Storyboard x:Name="PulseLogo">
                  <DoubleAnimation Storyboard.TargetName="UploadScale" Storyboard.TargetProperty="ScaleX"
                        From="1" To="1.7" Duration="0:0:1.0" RepeatBehavior="Forever" AutoReverse="True" />
                  <DoubleAnimation Storyboard.TargetName="UploadScale" Storyboard.TargetProperty="ScaleY"
                        From="1" To="1.5" Duration="0:0:1.0" RepeatBehavior="Forever" AutoReverse="True" />
                </Storyboard>
              </BeginStoryboard.Storyboard>
            </BeginStoryboard>
          </EventTrigger>
        </TextBlock.Triggers>
          <TextBlock.RenderTransform>
            <ScaleTransform x:Name="UploadScale" />
          </TextBlock.RenderTransform>
        Uploading</TextBlock>
    </Grid>
  </Grid>

</phone:PhoneApplicationPage>
